package com.he.controller;

import com.alibaba.fastjson.JSONObject;
import com.he.config.DingTalkAppConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootVersion;
import org.springframework.core.SpringVersion;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: user-sync
 * @description:
 * @author: xin.he
 * @create: 2021-06-11 13:03
 **/

@RestController
@RequestMapping("/config")
public class ConfigController {
    @Autowired
    DingTalkAppConfig DingTalkAppConfig;

    @GetMapping("/ding")
    public String ding (){
        return DingTalkAppConfig.toString();
    }

    @GetMapping("/version")
    public String Version (){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("SpringVersion", SpringVersion.getVersion());
        jsonObject.put("SpringBootVersion", SpringBootVersion.getVersion());
        return "[" + jsonObject + "]";
    }

}
